﻿using SearchStar.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SearchStar.Controllers
{
    public class HomeController : Controller
    {
        ArticleUIController artCon = new ArticleUIController("http://localhost:4367/", "api/article/");

        public ActionResult Index()
        {
            List<Article> articles;

            articles = artCon.SearchArticles("Canada");

            return View(articles);
        }

        public ActionResult SearchArticles()
        {

            return PartialView("_ArticlesPartialView", artCon.GetArticles("String")); ;
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
